import request from '@/utils/request'

// 查询命令执行列表
export function listCommand(query) {
  return request({
    url: '/exec/command/list',
    method: 'get',
    params: query
  })
}

export function listCommandLog(execCommandId,query) {
  return request({
    url: '/exec/commandlog/list/'+execCommandId,
    method: 'get',
    params: query
  })
}

// 查询命令执行详细
export function getExecProgress(id) {
  return request({
    url: '/exec/command/' + id,
    method: 'get'
  })
}

// 新增命令执行
export function execCommand(data) {
  return request({
    url: '/exec/command',
    method: 'post',
    data: data
  })
}

// 修改命令执行
export function updateCommand(data) {
  return request({
    url: '/exec/command',
    method: 'put',
    data: data
  })
}

// 删除命令执行
export function delCommand(id) {
  return request({
    url: '/exec/command/' + id,
    method: 'delete'
  })
}
